#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>

//https://leetcode.cn/problems/self-dividing-numbers/

bool isSelfDividing(int num) {
    for (int i = 1; num / i; i *= 10) {
        int tmp = (num / i) % 10;
        if (tmp == 0 || (num % tmp) != 0) {
            return false;
        }
    }
    return  true;
}

int* selfDividingNumbers(int left, int right, int* returnSize) {
    int *ret = malloc(sizeof(int) * right - left + 1);
    *returnSize = 0;
    while (left <= right) {
        if (isSelfDividing(left)) {
            ret[*returnSize] = left;
            (*returnSize)++;
        }
        left++;
    }
    return ret;
}
int main() {

    return 0;
}